package world.criver.h50529.controller;

import javafx.application.Platform;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
import world.criver.h50529.function.funStageMove;


public class conAffirmPop {
    public Label content;
    private Stage stage;
    private Runnable fun;
    private funStageMove funStageMove=new funStageMove();
    public void ini(String content,Runnable fun,Stage stage){
        this.content.setText(content);
        this.fun=fun;
        this.stage=stage;
    }
    public void onClose() {
        stage.hide();
    }

    public void onAccept() {
        Thread.startVirtualThread(fun);
        onClose();
    }

    public void onRelease(MouseEvent e) {
        funStageMove.onRelease();
    }

    public void onPress(MouseEvent e) {
        funStageMove.onPress(e.getScreenX(),e.getScreenY(),stage);
    }

    public void onDrag(MouseEvent e) {
        funStageMove.onDrag(e.getScreenX(),e.getScreenY(),stage);
    }
}
